home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 001-025 / disk_002 / microemacs / screen.asm < prev    next >
Assembly Source File  |  1992-05-06  |  4KB  |  184 lines

  1.  
  2.         page    60,132
  3.         title   Screen - Video Display Routines
  4.  
  5. ;************************************************************************
  6. ;*                                                                      *
  7. ;*      Copyright (c) 1985                                              *
  8. ;*      by Stephen Wilhite, 7431 Saunderlane Ct, Worthington, Ohio      *
  9. ;*                                                                      *
  10. ;************************************************************************
  11.  
  12. ;++
  13. ; ABSTRACT:
  14. ;
  15. ;       ?
  16. ;
  17. ; ENVIRONMENT: MS-DOS, DEC Rainbow 100B
  18. ;
  19. ; AUTHOR: Steve Wilhite, CREATION DATE: 15-Feb-85
  20. ;
  21. ; REVISION HISTORY:
  22. ;
  23. ;--
  24.         include dos.mac
  25.         pseg
  26. ;+
  27. ; Table of Contents:
  28. ;-
  29.  
  30. public  Put_Char                ; Write a character to the screen
  31. public  Put_Data                ; Write characters to the screeen
  32. public  Put_Data_A              ; Write characters & attributes to the screen
  33. public  Put_Attr                ; Write "n" attributes to the screen
  34. public  Beep                    ; Beep at user
  35.  
  36. ROM_LATOFS      equ     0EF4H
  37.  
  38. ; Define the structure of the video line
  39.  
  40. VLine   struc
  41.   Text  db      80 dup(?)
  42.   Term  db      ?
  43.   Link  dw      ?
  44. VLine   ends
  45.  
  46.         dseg
  47. Buffer  db      81 dup(?)
  48.         endds
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. ;+
  58. ;       Put_Char(Ch)
  59. ;-
  60. $proc Put_Char
  61.         push    BP
  62.         mov     BP,SP
  63.         push    ES
  64.         mov     DI,0
  65.         mov     AL,@ab[BP]
  66.         int     18H
  67.         pop     ES
  68.         pop     BP
  69.         ret
  70. $endp Put_Char
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79. ;+
  80. ;       Put_Data(Row, Col, Len, Buf)
  81. ;-
  82. $proc Put_Data
  83.         push    BP
  84.         mov     BP,SP
  85.         push    ES
  86.         mov     AX,2                    ; Character only, no attributes
  87.         mov     BL,@ab[BP]              ; Row (1-24)
  88.         mov     BH,@ab+2[BP]            ; Column (1-80)
  89.         mov     CX,@ab+4[BP]            ; Byte count
  90.         mov     SI,@ab+6[BP]            ; Data offset
  91.         mov     DI,14H                  ; Write data to screen
  92.         mov     BP,DS                   ; for ROM code
  93.         int     18H
  94.         pop     ES
  95.         pop     BP
  96.         ret
  97. $endp Put_Data
  98.  
  99. ;+
  100. ;       Put_Data_A(Row, Col, Len, Buf, Attr)
  101. ;-
  102. $proc Put_Data_A
  103.         push    BP
  104.         mov     BP,SP
  105.         push    ES
  106.         push    DS                      ; ES := DS
  107.         pop     ES
  108.         mov     CX,@ab+4[BP]            ; Byte count
  109.         mov     AL,@ab+8[BP]            ; Get attribute
  110.         mov     DI,offset Buffer
  111.         cld                             ; Forward direction
  112. rep     stosb                           ; Fill buffer with the attribute
  113.         mov     AX,0                    ; Attributes only
  114.         mov     BL,@ab[BP]              ; Row (1-24)
  115.         mov     BH,@ab+2[BP]            ; Column (1-80)
  116.         mov     CX,@ab+4[BP]            ; Byte count
  117.         mov     SI,@ab+6[BP]            ; Data offset
  118.         mov     DX,offset Buffer
  119.         mov     DI,14H                  ;
  120.         mov     BP,DS                   ; for ROM code
  121.         int     18H                     ; Write characters and attributes to
  122.         pop     ES                      ; the screen
  123.         pop     BP
  124.         ret
  125. $endp Put_Data_A
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134. ;+
  135. ;       Put_Attr(Row, Col, Count, Attr)
  136. ;-
  137. $proc Put_Attr
  138.         push    BP
  139.         mov     BP,SP
  140.         push    ES
  141.         push    DS                      ; ES := DS
  142.         pop     ES
  143.         mov     CX,@ab+4[BP]            ; Byte count
  144.         mov     AL,@ab+6[BP]            ; Get attribute
  145.         mov     DI,offset Buffer
  146.         cld                             ; Forward direction
  147. rep     stosb                           ; Fill buffer with the attribute
  148.         mov     AX,1                    ; Attributes only
  149.         mov     BL,@ab[BP]              ; Row (1-24)
  150.         mov     BH,@ab+2[BP]            ; Column (1-80)
  151.         mov     CX,@ab+4[BP]            ; Byte count
  152.         mov     DX,offset Buffer
  153.         mov     DI,14H                  ;
  154.         mov     BP,DS                   ; for ROM code
  155.         int     18H                     ; Write attributes to screen
  156.         pop     ES
  157.         pop     BP
  158.         ret
  159. $endp Put_Attr
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168. ;+
  169. ;       Beep()
  170. ;-
  171. $proc Beep
  172.         mov     AX,7                    ; BEL
  173.         push    AX
  174.         call    Put_Char
  175.         add     SP,2
  176.         ret
  177. $endp Beep
  178.  
  179.         endps
  180.         end
  181.  
  182.  
  183. OK
  184.